/*  
* Copyright (c) 2010, James Daniello
* This project is licensed under the 'New BSD' license.
* The full text of the license can be found in the root
* directory under the filename "LICENSE.
"
*/

package src.objects;

public class PICAIURectBounds extends PICAIUBounds{
  
  protected int width, height;
  
  
  /**
  * Creates a simple Square used as a set of bounds for collision detection.
  * @param xIn how far from left of parent object this square begins
  * @param yIn how far from top of parent object this square begins
  * @param widthIn how wide is this square
  * @param heightIn how tall is this square
  */
  public PICAIURectBounds(int xIn, int yIn, int widthIn, int heightIn){
    x=xIn;
    y=yIn;
    width=widthIn;
    height=heightIn;
    
    type=1; //1 = square
  }
  
  @Override
  public int getHeight(){
    return height;
  }
  
  @Override
  public int getWidth(){
    return width;
  }
  
  public boolean testPoint(float xIn, float yIn){
    if(xIn<x||
       xIn>x+width||
       yIn<y||
       yIn>y+height){
        System.out.println(xIn+" compared to "+x+" and "+(x+width));
        System.out.println(yIn+" compared to "+y+" and "+(y+height));
        return false;
       }else{
        return true;
       }
  }
  
}